From a49305a1f3f875e42449c73078781d03954ed446 Mon Sep 17 00:00:00 2001 From: Cody P Schafer Date: Fri, 5 Dec 2014 01:54:33 -0500 Subject: [PATCH] custom_build: build output goes in the directory for the req, not hard coded to Target This broke crossbuilds that had Host deps that used custom build scripts, typically resulting in a failure to link (due to bad relocations or symbols) the final executable or library. Probably should have rustc check when generating an rlib that all the containing objects have the appropriate arch. --- src/cargo/ops/cargo_rustc/custom_build.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cargo/ops/cargo_rustc/custom_build.rs b/src/cargo/ops/cargo_rustc/custom_build.rs index 07ccbaf5f..ed0307486 100644 --- a/src/cargo/ops/cargo_rustc/custom_build.rs +++ b/src/cargo/ops/cargo_rustc/custom_build.rs @@ -39,7 +39,7 @@ pub fn prepare(pkg: &Package, target: &Target, req: Platform, let kind = match req { Platform::Plugin => Kind::Host, _ => Kind::Target, }; let (script_output, build_output) = { (cx.layout(pkg, Kind::Host).build(pkg), - cx.layout(pkg, Kind::Target).build_out(pkg)) + cx.layout(pkg, kind).build_out(pkg)) }; // Building the command to execute -- 2.30.2